/* 
 * Copyright 2013-2020 Modeliosoft
 * 
 * This file is part of Modelio.
 * 
 * Modelio is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Modelio is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Modelio.  If not, see <http://www.gnu.org/licenses/>.
 * 
 */
package org.modelio.metamodel.impl.expert;

import com.modeliosoft.modelio.javadesigner.annotations.objid;
import org.modelio.metamodel.diagrams.GraphDiagram;
import org.modelio.metamodel.uml.infrastructure.ModelElement;
import org.modelio.vcore.smkernel.mapi.MClass;
import org.modelio.vcore.smkernel.mapi.MMetamodel;

/**
 * Infrastructure complete metamodel expert.
 * <p>
 * This expert derives from the expert generated by SemGen and adds customs experts.
 * </p>
 */
@objid ("e6e7022d-96fe-4773-aa3a-072a80a27992")
public class InfrastructureMetamodelExpert extends InfrastructureGeneratedMetamodelExpert {
    /**
     * @param mm the metamodel.
     */
    @objid ("8fe1f4d0-3cce-41f0-a068-3479c4e372ab")
    public  InfrastructureMetamodelExpert(MMetamodel mm) {
        super(mm);
        
        register();
        
    }

    @objid ("765824fe-69ce-444b-b942-7f62529d626f")
    @Override
    public boolean isLink(MClass metaclass) {
        /*switch (metaclass.getName()) {
        case Dependency.MNAME:
        case ImpactLink.MNAME:
            return true;
        default:
            return false;
        }*/
        return metaclass.isLinkMetaclass();
    }

    @objid ("28a3ac4b-825d-4c00-87d4-edb0ed615f91")
    @Override
    protected void registerMetaExpertForGraphDiagram() {
        super.registerMetaExpertForGraphDiagram();
        
        this.ruleMetaExpert.addCompositionRule(ModelElement.class, GraphDiagram.class, "Product");
        
    }

}
